xml = Builder::XmlMarkup.new
xml.chart(\
:showMean=>1, :caption=> caption, :palette=>"2", :animation=>"1", :formatNumberScale=>"0", \
:numberPrefix=>"", :labeldisplay=>"ROTATE", :slantLabels=>"1", :seriesNameInToolTip=>"0", \
:sNumberSuffix=>" pcs.", :showValues=>"0", :plotSpacePercent=>"0", :labelDisplay=>"STAGGER") do
  for item in arr_data
    areacode = item[0]
    sum_calls = item[1]
    xml.set(:label=>areacode, :value=>sum_calls, :link=>"/#{controller.controller_name}/src_phone_detail/#{areacode}?from=#{params["from"]}&iso=#{params["iso"]}&p=#{params["p"]}&to=#{params["to"]}")
  end

  xml.styles() do
    xml.definition() do
      xml.style(:type=>"font", :name=>"CaptionFont", :size=>"15", :color=>"666666")
      xml.style(:type=>"font", :name=>"SubCaptionFont", :bold=>"0")
    end
    xml.application()do
      xml.apply(:toObject=>"caption", :styles=>"CaptionFont")
      xml.apply(:toObject=>"SubCaption", :styles=>"SubCaptionFont")
    end
  end # styles
end # chart